<?php
	require_once("../../db/dbclass.php");
	require_once("../../utils/common.php");
	$myDb=&DbController::getInstance();
	$array = array();
	$user_id=$_POST['user_id'];
	$param="SELECT * FROM yj_user_info WHERE user_id='".$user_id."'";
	$result=$myDb->exec_query($param);
	if($result==TRUE){
		$i=0;
		while ($row=mysqli_fetch_array($result,MYSQL_ASSOC)) {
			$array[$i++]=$row['user_name'];
			$array[$i++]=$row['user_nickname'];
			$array[$i++]=$row['user_sign'];
			$array[$i++]=$row['user_work'];
			$array[$i++]=$row['user_location'];
			break;
		}
		$param="SELECT * FROM yj_login_record WHERE user_id='".$user_id."'";
		$result=$myDb->exec_query($param);
		if($result==TRUE){
			while ($row=mysqli_fetch_array($result,MYSQL_ASSOC)){
				$array[$i++]=$row['login_time'];
				$array[$i++]=$row['login_ip'];
				break;
			}
			$result="1";
		}else{
			$result="2";
		}
	}
	else{
		$result="2";
	}
	$i=0;
	if($result=="1"){
		$arr = array('result' =>"1" ,
			'姓名'=>$array[$i++],
			'昵称'=>$array[$i++],
			'签名'=>$array[$i++],
			'职业'=>$array[$i++],
			'现居地'=>$array[$i++],
			'上次登录时间'=>$array[$i++],
			'登陆地址'=>$array[$i++]
		 );
		echo json_encode($arr);
	}else{
		$arr = array('result' =>"2");
		echo json_encode($arr);
	}

?>